package pl.itconsus.model.entities.utils;

import java.util.Calendar;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;

@MappedSuperclass
public abstract class BaseHistoryEntity<ID> extends BaseEntity<ID> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7913503493364181510L;

	private Calendar startTime = Calendar.getInstance();
	private Calendar endTime;
	private boolean active = true;

	@Past
	@NotNull
	@Basic(optional = false)
	@Column(name = "start_time", nullable = false, length = 10)
	@Temporal(TemporalType.TIMESTAMP)
	public Calendar getStartTime() {
		return startTime;
	}

	public void setStartTime(Calendar startTime) {
		this.startTime = startTime;
	}

	@Basic
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_time", length = 10)
	public Calendar getEndTime() {
		return endTime;
	}

	public void setEndTime(Calendar endTime) {
		this.endTime = endTime;
	}
	@NotNull
	@Basic(optional = false)
	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}
	

}
